<template>
    <el-tabs v-model="activeName" @tab-click="handleClick"
        v-if="isShow(['kanke:textbook:classcourse:courseware-list', 'kanke:textbook:classcourse:textbook-list'])">
        <el-tab-pane label="课本" name="book"
            v-if="hasPermission('kanke:textbook:classcourse:textbook-list') && ((activeName == 'book' && $route.query.type) || !$route.query.type)">
            <TabPane v-if="activeName == 'book'" :type="activeName" />
        </el-tab-pane>
        <el-tab-pane label="课件" name="other"
            v-if="hasPermission('kanke:textbook:classcourse:courseware-list') && ((activeName == 'other' && $route.query.type) || !$route.query.type)">
            <TabPane :type="activeName" v-if="activeName == 'other'" />
        </el-tab-pane>
    </el-tabs>
</template>
<script>
import { hasPermission, isShow } from '@/common/permission';
export default {
    name: "KanKeTextbookClassCourse",
    components: {
        TabPane: () => import('./components/CoursePane.vue')
    },
    data() {
        return {
            activeName: this.$route.query.type || 'book'
        }
    },
    methods: {
        hasPermission,
        isShow,
        handleClick(tab, event) {
            this.activeName = tab.name
        }
    }

}
</script>
<style lang="scss" scoped></style>